﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvvmTreeView;
using AbstraX.ViewModels;
using System.Diagnostics;

namespace TreeCollectionTest
{
    class Program
    {
        static void Main(string[] args)
        {
            TreeNodeCollection collection = new TreeNodeCollection();
            var nodes = new List<ITreeNode>() 
            {
                new TreeNodeTest("b2", 2),
                new TreeNodeTest("a1", 1),
                new TreeNodeTest("c1", 1),
                new TreeNodeTest("a2", 2),
                new TreeNodeTest("b1", 1),
                new TreeNodeTest("c2", 2),
            };

            foreach (var node in nodes)
            {
                collection.InsertOrderBy(n => n.ChildOrdinal).ThenBy(n => n.Text, node);
            }

            foreach (var node in collection)
            {
                Debug.WriteLine(node.Text);
            }
        }
    }
}
